﻿using System.ServiceProcess;
using System.ComponentModel;
using System.Configuration.Install;

namespace Ayatta.Service.Product.Index
{
    [RunInstaller(true)]
    public class ProjectInstaller : Installer
    {
        public ProjectInstaller()
        {
            var serviceProcessInstaller = new ServiceProcessInstaller();
            var serviceInstaller = new ServiceInstaller();
            // 
            // serviceProcessInstaller
            // 
            serviceProcessInstaller.Account = ServiceAccount.LocalSystem;
            serviceProcessInstaller.Password = null;
            serviceProcessInstaller.Username = null;
            // 
            // serviceInstaller
            // 
            serviceInstaller.ServiceName = Program.ServiceName;
            serviceInstaller.Description = Program.Description;
            serviceInstaller.StartType = ServiceStartMode.Automatic;
            // 
            // ProjectInstaller
            // 
            Installers.AddRange(new Installer[] {
            serviceProcessInstaller,
            serviceInstaller});
        }
    }
}